﻿using System;

namespace Adaptive.Foundation.Parsing
{
    /// <summary>
    /// Provides a base implementation for creating algorithm- or data- specific
    /// parsing providers.
    /// </summary>
    public abstract class ParsingProviderBase : AiObjectBase, IParsingProvider 
    {
        /*--------------------------------------------------------------------------------
         * Public Events
         *------------------------------------------------------------------------------*/
        #region Public Events
        #endregion

        /*--------------------------------------------------------------------------------
         * Private Member Declarations
         *------------------------------------------------------------------------------*/
        #region Private Member Declarations
        #endregion

        /*--------------------------------------------------------------------------------
         * Constructor / Dispose Methods
         *------------------------------------------------------------------------------*/
        #region Constructor / Dispose Methods
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <remarks>
        /// This is the default constructor.
        /// </remarks>
        protected ParsingProviderBase()
            : base()
        {
        }
        /// <summary>
        /// Deallocates internally allocated objects.
        /// </summary>
        /// <param name="disposing">
        /// A value indicating whether the object is being disposed.
        /// </param>
        protected override void Dispose(bool disposing)
        {
            if ((!Disposed) && (disposing))
            {
            }

            base.Dispose(disposing);
        }
        #endregion

        /*--------------------------------------------------------------------------------
         * Public Properties
         *------------------------------------------------------------------------------*/
        #region Public Properties
        #endregion

        /*--------------------------------------------------------------------------------
         * Protected Methods
         *------------------------------------------------------------------------------*/
        #region Protected Methods
        #endregion

        /*--------------------------------------------------------------------------------
         * Public Methods / Functions
         *------------------------------------------------------------------------------*/
        #region Public Methods / Functions
        /// <summary>
        /// Gets the rules defined in the provider.
        /// </summary>
        /// <returns>
        /// A <see cref="ParsingTokenRuleCollection"/> containing the rule definitions.
        /// </returns>
        public abstract ParsingTokenRuleCollection GetRules();
        /// <summary>
        /// Gets an instance of the parser.
        /// </summary>
        /// <returns>An <see cref="IParser"/> instance.</returns>
        public abstract IParser GetParser();
        /// <summary>
        /// This method must be overidden to provide text when instances
        /// are included in lists.
        /// </summary>
        /// <returns>
        /// The display test for the implementation.
        /// </returns>
        public abstract override string ToString();
        #endregion

        /*--------------------------------------------------------------------------------
         * Private Methods / Functions
         *------------------------------------------------------------------------------*/
        #region Private Methods / Functions
        #endregion
    }
}